<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
    <title>WeUI</title>
    <link rel="stylesheet" href="../../css/weui.css"/>
    <link rel="stylesheet" href="../../css/perInfo.css"/>
    <script src="../../js/jquery-2.1.1.min.js"></script>
    <script src="../../js/jquery.form.min.js"></script>
    <script src="../../layer/layer.js"></script>
    <script src="../../js/main.js"></script>
    <title>专利资源</title>
</head>

<body>


<div id="d" style="padding-bottom:10%;width:100%;height:0;margin-top: 1rem;background-color: black;margin-top: 0px;">
    <div style="width:70%;margin:auto auto;">
        <img src="../../img/index/top.png" style="height: auto;width:100%; margin:auto auto;"/>
    </div>
</div>


<form id="ajForm" method="post">
    <div class="weui-cells weui-cells_form">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">专利名称</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="text" name="name" placeholder="请输入专利名称">
            </div>
        </div>


        <div class="weui-cells weui-cells_form">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">专利证书照片</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" name="pic" type="file">
                </div>
            </div>


            <div class="weui-cells weui-cells_form">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" name="username" type="text" placeholder="请输入专利持有人姓名">
                    </div>
                </div>


                <div class="weui-cell">
                    <div class="weui-cell weui-cell_select">
                        <div class="weui-cell__hd">专利类型:</div>
                        <div class="weui-cell__bd">
                            <select class="weui-select" name="clazz">
                                <option value="发明专利">发明专利</option>
                                <option value="实用新型专利">实用新型专利</option>
                                <option value="外观设计专利">外观设计专利</option>
                                <option value="国际专利">国际专利</option>
                            </select>
                        </div>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">专利授权号</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" type="text" name="authorization" placeholder="请输入专利授权号">
                    </div>
                </div>

                <div class="weui-btn-area">
                    <input type="submit" class="weui-btn weui-btn_primary" id="showTooltips" value="提交">
                </div>
            </div>
        </div>
    </div>
    <script>
        $.ajaxSetup({
            xhrFields: {
                withCredentials: isCrossDomain
            }
        });
        $(function () {
            var options = {
                // 规定把请求发送到那个URL
                url: mainurl+"skill/addPatent",
                // 请求方式
                type: "post",
                // 服务器响应的数据类型
                dataType: "json",
                beforeSubmit: function (formData, jqForm, options) {
                    for(i=0; i<formData.length; i++) {
                        if(formData[i].value==''){
                            warnInfo("参数不能为空");
                            return false;
                        }
                    }
                    return true;
                },
                // 请求成功时执行的回调函数
                success: function(data, status, xhr) {
                    if(checkData(data)) {
                        successInfo("发布成功");
                        // window.history.back(-1);
                    }
                },
                clearForm: true
            };
            $("#ajForm").ajaxForm(options);
        })
    </script>
</form>
</body>

</html>